<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <script type="text/javascript" src="./script/rem.js"></script>
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="yes" name="apple-touch-fullscreen">
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <link rel="stylesheet" type="text/css" href="./css/font-awesome.css" />
    <link rel="stylesheet" type="text/css" href="./css/style.css" />
    <script type="text/javascript" src="./script/aui-slide.js"></script>
    <script type="text/javascript" src="./script/jquery.min.js"></script>
    <script type="text/javascript" src="./script/doT.min.js"></script>
    <script type="text/javascript" src="./script/base.js"></script>
    <script type="text/javascript" src="./script/api.js"></script></head>
    <script type="text/javascript" src="./script/aui-tab.js" ></script>
    <script type="text/javascript" src="./script/jquery-3.2.0.js"></script>
</head>
<body>

    <header class="head" style="padding-top:0.4rem;">
        <div class="head-l" tapmode onclick="closeWin()"><i class="fa fa-angle-left"></i></div>
        <h3>邀请码</h3>
        <div class="head-r"></div>
    </header>
    <div class="head-d" style="padding-top:0.4rem;"></div>

    <style>
        body{background:#fff;}
    </style>
    <div class="invite-code">
        <dl>
            <dt>你的邀请<span onclick="copy();">复制</span></dt>
            <dd id="code">8HEFYS</dd> 
        </dl>
        <div class="invite-code-d">
            邀请码用来邀请朋友加入
            <p>（注册时使用）</p>
        </div>
    </div>


</body>
<script type="text/javascript" src="./script/api.js"></script>
<script type="text/javascript" src="./script/index.js"></script>
<script type="text/javascript">

    apiready = function(){
        code = api.pageParam.code;
        $('#code').text(code);
    }
    
    // 复制邀请码
    function copy(){
        var clipBoard = api.require('clipBoard');
        clipBoard.set({
            value: code
        }, function(ret, err) {
            if (ret) {
                api.toast({
                    msg: '复制成功',
                    duration: 2000,
                    location: 'bottom'
                });  
                // clipBoard.get(function(ret, err) {
                //     if (ret) {
                //         // alert(JSON.stringify(ret));
                //     } else {
                //         // alert(JSON.stringify(err));
                //     }
                // });
            } else {
                // alert(JSON.stringify(err));
            }
        });
    }

    function closeWin(){
        api.closeWin({
        });
    }
</script>
</html>